package com.sumi.erp.service.impl;

import java.util.List;
import com.sumi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sumi.erp.mapper.BaseProductCategoryMapper;
import com.sumi.erp.domain.BaseProductCategory;
import com.sumi.erp.service.IBaseProductCategoryService;

/**
 * 商品分类Service业务层处理
 * 
 * @author fgf67@163.com
 * @date 2024-06-20
 */
@Service
public class BaseProductCategoryServiceImpl implements IBaseProductCategoryService 
{
    @Autowired
    private BaseProductCategoryMapper baseProductCategoryMapper;

    /**
     * 查询商品分类
     * 
     * @param id 商品分类主键
     * @return 商品分类
     */
    @Override
    public BaseProductCategory selectBaseProductCategoryById(Long id)
    {
        return baseProductCategoryMapper.selectBaseProductCategoryById(id);
    }

    /**
     * 查询商品分类列表
     * 
     * @param baseProductCategory 商品分类
     * @return 商品分类
     */
    @Override
    public List<BaseProductCategory> selectBaseProductCategoryList(BaseProductCategory baseProductCategory)
    {
        return baseProductCategoryMapper.selectBaseProductCategoryList(baseProductCategory);
    }

    /**
     * 新增商品分类
     * 
     * @param baseProductCategory 商品分类
     * @return 结果
     */
    @Override
    public int insertBaseProductCategory(BaseProductCategory baseProductCategory)
    {
        baseProductCategory.setCreateTime(DateUtils.getNowDate());
        return baseProductCategoryMapper.insertBaseProductCategory(baseProductCategory);
    }

    /**
     * 修改商品分类
     * 
     * @param baseProductCategory 商品分类
     * @return 结果
     */
    @Override
    public int updateBaseProductCategory(BaseProductCategory baseProductCategory)
    {
        return baseProductCategoryMapper.updateBaseProductCategory(baseProductCategory);
    }

    /**
     * 批量删除商品分类
     * 
     * @param ids 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteBaseProductCategoryByIds(Long[] ids)
    {
        return baseProductCategoryMapper.deleteBaseProductCategoryByIds(ids);
    }

    /**
     * 删除商品分类信息
     * 
     * @param id 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteBaseProductCategoryById(Long id)
    {
        return baseProductCategoryMapper.deleteBaseProductCategoryById(id);
    }
}
